<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/Public/css/pintuer.css">
<link rel="stylesheet" href="/Public/css/admin.css">
<script src="/Public/js/jquery.js"></script>
<script src="/Public/js/pintuer.js"></script>

<style type="text/css">
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
/* .input{width:50%;} */
select{height:40px;}
.selinp{width: 15%;font-size: 14px;padding: 10px;display:inline;border: solid 1px #ddd;line-height: 20px;border-radius: 3px;}
</style>  
 
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>编辑栏目</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="<?php echo U('Admin/Tag/edit');?>">
      <input type="hidden" name="id" value="<?php echo ($data["id"]); ?>" />
     
      <div class="form-group">
        <div class="label">
          <label>标签名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50"  placeholder="请输入标签名称" value="<?php echo ($data["name"]); ?>" name="name" data-validate="required:请输入标签名称" />
          <div class="tips"></div>
        </div>
      </div>
       
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

<script>
$("#cate").val("<?php echo ($data["pid"]); ?>");
$("#mokuai").val("<?php echo ($data["block"]); ?>");

var opt0 = '<input type="text" id="urlz" class="selinp" style="height:40px;" name="url" value="http://" />';
var opt1 = '<select name="cid" id="wez" class="selinp"><?php if(is_array($data1)): foreach($data1 as $key=>$item): ?><option value ="<?php echo ($item["id"]); ?>"><?php echo ($item["name"]); ?></option><?php endforeach; endif; ?></select>';
var opt2 = '<select name="cid" id="picz" class="selinp"><?php if(is_array($data2)): foreach($data2 as $key=>$item): ?><option value ="<?php echo ($item["id"]); ?>"><?php echo ($item["title"]); ?></option><?php endforeach; endif; ?></select>';

$("#mokuai").change(function(){

	var mkid=$(this).val();
	
	if(mkid==1){
		
		$("#ccss").html(opt1);
		
	}else if(mkid==2){
		
		$("#ccss").html(opt2);
		
	}else if(mkid==0){
		
		$("#ccss").html(opt0);
		
	}
	
	});
	
switch(<?php echo ($data["block"]); ?>){

case 0:
	$("#ccss").html(opt0);
	$("#urlz").val("<?php echo ($data["url"]); ?>");
	break;
case 1:
	$("#ccss").html(opt1);
	$("#wez").val("<?php echo ($defdata["id"]); ?>");
	break;
case 2:
	$("#ccss").html(opt2);
	$("#picz").val("<?php echo ($defdata["id"]); ?>");
	break;
}

</script>

</body></html>